package com.zjhome.itoken.service.sso.service.consumer;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.zjhome.itoken.service.sso.service.consumer.fallback.RedisServiceFallback;

@FeignClient(value = "itoken-service-redis", fallback=RedisServiceFallback.class)
public interface RedisService {
	
	/**
	 * 通过redis 设置值
	 * @param key
	 * @param value
	 * @param seconds
	 * @return
	 */
	@RequestMapping(value = "put", method = RequestMethod.POST)
	public String put(
			@RequestParam(value = "key") String key, 
			@RequestParam(value = "value") String value, 
			@RequestParam(value = "seconds") long seconds
	);
	
	
	/**
	 * 获取指定key的值
	 * @param key
	 * @return
	 */
	@RequestMapping(value = "get", method = RequestMethod.GET)
	public String get(@RequestParam(value = "key") String key);	
}
